package org.maplanning;

import org.maplanning.GridMap.StrategyI;

/** Strategy that loops around fixed actions */
public class FixedStrat implements StrategyI {
	char[] actions;
	int currentAction;
	
	public FixedStrat(char... actions) {
		this.currentAction = 0;
		this.actions = actions;
	}
	
	/**
	 * infinite loop of actions
	 */
	@Override
	public char act(GridMap map) {
		char action = actions[currentAction];
		currentAction++; // next action
		if (currentAction>=actions.length) {
			currentAction=0; // next loop
		}
		return action;
	}
	
}
